package main

import (
	"fmt"
	"sort"
)

func main() {
	var m map[int] string;
	m = make(map[int]string)
	mm1 := make(map[int]string)
	fmt.Println(m, mm1)
	m[1] = "OK"
	fmt.Println(m)
	a:=m[1]
	fmt.Println(a)

	m1 := make(map[int]map[int]string)
	m1[1] = make(map[int]string)
	m1[1][1] = "ok"
	m1[1][2] = "yes"
	a1, ok := m1[1][1]
	fmt.Println(m1)
	fmt.Println(a1, ok)
	sm:= make([]map[int]string, 5)
	for i := range sm{
		sm[i]=make(map[int]string, 1)
		sm[i][1] = "ok"
		fmt.Println(sm[i])
	}
	fmt.Println(sm)

	m2:=map[int]string{1:"a",2:"b",3:"c",4:"d"}
	s2:=make([]int, len(m2))
	i:=0
	for k,_ := range m2{
		s2[i] = k
		i++
	}
	fmt.Println(s2)
	sort.Ints(s2)
	fmt.Println(s2)


	m3 := map[int]string{1:"a",2:"b",3:"c",4:"d"}
	m4 := make(map[string]int)
	for k,v := range m3{
		m4[v] = k
	}
	fmt.Println(m3)
	fmt.Println(m4)
}
